//
//  Player.cpp
//  LitterRunner
//
//  Created by 李阳 on 15/11/20.
//
//

#include "Player.hpp"
Player::Player(){
    m_isjumping = false;
}
Player::~Player(){
    
}
bool Player::init(){
    return true;
}
void Player::jump(){
    if (getSprite() == NULL) {
        return;
    }
    if (m_isjumping) {
        return;
    }
    m_isjumping = true;
    CCJumpBy *jump = CCJumpBy::create(2.0f, ccp(0, 0), 350, 1);
    CCCallFunc *callFunc = CCCallFunc::create(this, callfunc_selector(Player::jumpEnd));
    CCActionInterval *jumpActions = CCSequence::create(jump,callFunc,NULL);
    getSprite()->runAction(jumpActions);
    
}
void Player::jumpEnd(){
    m_isjumping = false;
}








